class NumbersTxtPage extends BaseScreen {
    public constructor() {
        super();
        this.skinName = "resource/eui_skins/NumbersTxt.exml";
    }

	public num_txt:eui.Label;

	public move_num:number = 100;
	public cur_num:number = 0;
	public move_time:number = 2000;
	public start_time:number = 0;
	private is_move:boolean = false;
	private off_time:number = 0;
	private off_start_time:number = 0;
	private fuhao:string = '';
	private status:number = 1;
	private result_str:string = '';
	public startMove(nums:number,of_time:number,m_time:number = 2000,font_size:number=33,fh:string = '',_result:string = ''){
		this.is_move = true;
	
		this.off_start_time = egret.getTimer();

		this.move_num = nums;
		this.move_time = m_time;
		this.off_time = of_time;
		this.status = 1;
		this.num_txt.size = font_size;
		this.fuhao = fh;
		this.result_str = _result;
	}

	public updateNum(){
		if(!this.is_move)
			return;
		
		var cha_off_time:number = egret.getTimer() - this.off_start_time;

		if(this.status == 1){
			if(cha_off_time>this.off_time){
				this.status = 2;
				this.start_time = egret.getTimer();
				this.visible = true;
			}
		}
		else if(this.status == 2){
			var cha_time:number = egret.getTimer() - this.start_time;
		
			var cur_number:number = (cha_time/this.move_time) * this.move_num;
			cur_number = Math.floor(cur_number);
			this.num_txt.text = cur_number.toString()+ this.fuhao;
			if(cha_time > this.move_time){
				cur_number = this.move_num;
				this.is_move = false;
				this.num_txt.text = this.result_str;
			}
			
		}
		
	}

}